class Mansione < ActiveRecord::Base
  acts_as_paranoid unless SHOW_DELETED
  TIPO_MANSIONE = ["base", "accessoria", "incarico", "rapporto sociale"]
  belongs_to :centro_costo
  has_and_belongs_to_many :tipi_visita_medica, :join_table => 'mansioni_tipi_visita_medica', :uniq => true, :class_name => 'TipoVisitaMedica'
  has_and_belongs_to_many :personale, :join_table => 'mansioni_personale', :uniq => true
  has_and_belongs_to_many :requisiti_formativi, :join_table => 'mansioni_requisiti_formativi', :uniq => true, :class_name => 'RequisitoFormativo'
  validates_presence_of :name
  validates_uniqueness_of :name, :scope => :deleted_at, :case_sensitive => false
end
